*DENSITY and continuity TESTs

* recall to have the 
clear all
use "ESS.dta" 

*DCdensity r if reform=="SE (1962)", breakpoint(0) b(1) h(5) generate(Xj Yj r0 fhat se_fhat)
	
foreach x in "AT (1966)" "BE (1983)" "CH (1956+)" "CZ (1961)" "DE (varies by region)" "DK (1958)" "EE (1959)" "ES (1969)" "FI (varies by region)" "FR (1967)" "GB (1947)"  "GR (1975)" "IE (1967)" "IS (1974)" "IT (1963)" "LT (1959)" "NL (1974)" "NO (1959+)" "PL (1967)" "PT (1964)" "RU (1959)" "SE (1962)" "SI (1959)" "SK (1961)" "UA (1959)" {
	di "******************** Reform = `x' **********************"
	DCdensity r if reform=="`x'", breakpoint(0) b(1) h(5) generate(Xj Yj r0 fhat se_fhat)  
	graph save Graph "g_`x'.gph", replace
	drop Xj Yj r0 fhat se_fhat
	rddensity r if reform=="`x'", c(0)
}
 
    		
	gr combine "g_AT (1966).gph" "g_BE (1983).gph" "g_CH (1956+).gph" "g_CZ (1961).gph" "g_DE (varies by region).gph" "g_DK (1958).gph" "g_EE (1959).gph" "g_ES (1969).gph" "g_FI (varies by region).gph" "g_FR (1967).gph" "g_GB (1947).gph"   "g_GR (1975).gph" "g_IE (1967).gph" "g_IS (1974).gph" "g_IT (1963).gph" "g_LT (1959).gph" "g_NL (1974).gph" "g_NO (1959+).gph" "g_PL (1967).gph" "g_PT (1964).gph" "g_RU (1959).gph" "g_SE (1962).gph" "g_SI (1959).gph" "g_SK (1961).gph" "g_UA (1959).gph",  rows(5) cols(5) subtitle(, color(black) fcolor(white) lcolor(white)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))
graph export "AppendixB_1.png", replace 
 